<ui:composition template="/WEB-INF/templates/test-template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:composite="http://java.sun.com/jsf/composite">
	<ui:define name="main-content">
		<h:outputLabel for="studyCodeMenu" value="Study Type" />
		<p:selectOneMenu id="studyCodeMenu"
			value="#{academicCalendarMB.studyCode}">
			<f:selectItem itemLabel="All" itemValue="0" />
			<f:selectItems
				value="#{academicCalendarMB.studyTypeList}"
				var="studyTypeList"
				itemLabel="#{studyTypeList.studyDesc}"
				itemValue="#{studyTypeList.studyCode}" />
		</p:selectOneMenu>
		<h:outputLabel for="semesterMenu" value="Semesters" />
		<p:selectOneMenu id="semesterMenu" filter="true"
			value="#{academicCalendarMB.semester}">
			<f:selectItem itemLabel="All" itemValue="0" />
			<f:selectItems
				value="#{academicCalendarMB.semesterList}"
				var="semesterList"
				itemLabel="#{semesterList.semester}"
				itemValue="#{semesterList.semester}" />
		</p:selectOneMenu>
		<p:commandButton value="Submit" update="academicCalTbl"
			actionListener="#{academicCalendarMB.refreshAcademicCalendar}" />
		<p:dataTable id="academicCalTbl" var="cal"
			value="#{academicCalendarMB.entitiesList}" paginator="true" rows="20">
			<p:column headerText="Semester">
				<h:outputText value="#{cal.academicCalendarPK.semester}" />
			</p:column>
			<p:column headerText="Study Code">
				<h:outputText value="#{cal.academicCalendarPK.studyCode}" />
			</p:column>
			<p:column headerText="Calendar Item">
				<h:outputText value="#{cal.calendarItem.itemDesc}" />
			</p:column>
			<p:column headerText="Start Date">
				<h:outputText value="#{cal.startDate}">
					<f:convertDateTime pattern="EEE, DD/MM/yyyy" />
				</h:outputText>
			</p:column>
			<p:column headerText="Start Date">
				<h:outputText value="#{cal.endDate}">
					<f:convertDateTime pattern="EEE, DD/MM/yyyy" />
				</h:outputText>
			</p:column>
		</p:dataTable>
	</ui:define>
</ui:composition>